home *** CD-ROM | disk | FTP | other *** search
- property pSpr, pOrigMember, pBarPosition, pCharCode, pStatus, pMouthSprite, pOrigLocH, pIngredient, pArrived, pCharList, pIngredientNum, pBonusPatience, pBonusPoints, pFirstTime
- global gWrongAnswers, gRightAnswers, gSoundFX2chan
-
- on endSprite
- pSpr.visible = 1
- end
-
- on beginSprite me
- global gImplementedCharacters, gPauseTime
- pStatus = #new
- pCharList = []
- repeat with Y = 1 to count(gImplementedCharacters)
- add(pCharList, getPropAt(gImplementedCharacters, Y))
- end repeat
- pSpr = sprite(me.spriteNum)
- pOrigLocH = pSpr.locH
- pMouthSprite = sprite(me.spriteNum + 1)
- pMouthSprite.locH = 5000
- pSpr.locH = 5000
- pSpr.visible = 0
- pFirstTime = 1
- pBonusPatience = currentLevel(#BONUSPATIENCE)
- pBonusPoints = currentLevel(#BONUSTIPSPERCORRECTANSWER)
- pCharCode = VOID
- end
-
- on mAppear me, waitFor
- global gBonusCharacters, gGameLevel
- pStatus = #appear
- pSpr.locH = pOrigLocH
- conflict = 1
- repeat while conflict = 1
- newChar = randomFromList(pCharList)
- conflict = 0
- repeat with X in gBonusCharacters
- if sprite(X).pCharCode = newChar then
- conflict = 1
- end if
- end repeat
- end repeat
- pCharCode = newChar
- pIngredientNum = random(50)
- pIngredient = findingredientbyid(pIngredientNum)
- repeat while ((gGameLevel = 1) and getXbottleness(pIngredient)) or badIngredient(me)
- pIngredientNum = random(50)
- pIngredient = findingredientbyid(pIngredientNum)
- end repeat
- pOrigMember = member(pCharCode & "_B", "bonusch")
- pMouthSprite.member = member(pCharCode & "_C", "bonusch")
- pSpr.visible = 1
- pSpr.member = pOrigMember
- playBonusSound(gSoundFX2chan, "BRA_X01")
- end
-
- on badIngredient me
- global gExcludeBonusList
- return getOne(gExcludeBonusList, pIngredient) or (pIngredientNum = 34)
- end
-
- on order me
- pStatus = #ordered
- playDrink(me, pIngredientNum)
- end
-
- on exitFrame me
- if pFirstTime = 1 then
- pFirstTime = 2
- exit
- else
- if pFirstTime = 2 then
- pArrived = now() + (seconds(currentLevel(#BONUSSPACING)) * (pBarPosition - 1))
- pFirstTime = 0
- end if
- end if
- if inMenuMode() then
- exit
- end if
- if soundBusy(pBarPosition) then
- pMouthSprite.locH = pSpr.locH
- else
- pMouthSprite.locH = 5000
- end if
- if inSlotMode() then
- if (timeHere(me) > 0) and (pStatus = #slots) then
- playBonusSound(gSoundFX2chan, "BRA_X01")
- pSpr.visible = 1
- pArrived = now()
- pStatus = #onStage
- else
- if (timeHere(me) > 0) and (pStatus = #onStage) then
- order(me)
- pStatus = #done
- end if
- end if
- exit
- end if
- if (timeHere(me) > 0) and (pStatus = #new) then
- mAppear(me)
- else
- if (timeHere(me) > 90) and (pStatus = #offStage) then
- mAppear(me)
- else
- if (timeHere(me) > seconds(pBonusPatience)) and (pStatus = #ordered) then
- mLeave(me, 1)
- else
- if (timeHere(me) > 30) and (pStatus = #appear) then
- repeat with X = 1 to 3
- if soundBusy(X) then
- exit
- end if
- end repeat
- order(me)
- end if
- end if
- end if
- end if
- end
-
- on timeHere me
- return elapsedTime(pArrived)
- end
-
- on mLeave me, loud
- if loud then
- playBonusSound(pBarPosition, "BRA_X02")
- end if
- pSpr.locH = 5000
- pArrived = now()
- pStatus = #offStage
- pCharCode = VOID
- pIngredientNum = 0
- end
-
- on mouseUp me
- if pIngredient = 0 then
- exit
- else
- mDropIngredient(me)
- end if
- end
-
- on mDropIngredient me
- global gLastIngredient
- if gLastIngredient <> pIngredient then
- playDrink(me, pIngredientNum)
- if gLastIngredient <> 0 then
- gWrongAnswers = gWrongAnswers + 1
- end if
- return 0
- end if
- gRightAnswers = gRightAnswers + 1
- gLastIngredient = 0
- pMouthSprite.locH = 5000
- playBonusSound(pBarPosition, "BRA_X06")
- pSpr.member = member(pCharCode & "_D", "bonusch")
- updateStage()
- replaceDraggingAnything()
- playBonusSound(pBarPosition, "BRA_X07")
- regTip(pBonusPoints, 1)
- mLeave(me)
- return 1
- end
-
- on toughLove me
- mLeave(me)
- pArrived = now() + (seconds(currentLevel(#BONUSSPACING)) * (pBarPosition - 1))
- end
-
- on getPropertyDescriptionList me
- return [#pBarPosition: [#default: 1, #format: #integer, #range: [1, 2, 3], #comment: "BarSlot"]]
- end
-
- on playDrink me, ingredientNum
- ing = string(ingredientNum)
- if length(ing) < 2 then
- put "0" before ing
- end if
- pMouthSprite.locH = pSpr.locH
- updateStage()
- playBonusSound(pBarPosition, "BRA_I" & ing)
- end
-
- on slots me
- pSpr.visible = 0
- pMouthSprite.locH = 5000
- pStatus = #slots
- pSpr.locH = pOrigLocH
- pCharCode = randomFromList(pCharList)
- pIngredientNum = randomFromList([35, 36, 37, 38, 39, 40, 41])
- pIngredient = findingredientbyid(pIngredientNum)
- pOrigMember = member(pCharCode & "_B", "bonusch")
- pMouthSprite.member = member(pCharCode & "_C", "bonusch")
- pSpr.member = pOrigMember
- pArrived = now() + seconds(0.5) + (seconds(1.5) * (pBarPosition - 1))
- end
-